package com.platform.qujia.enums;

import com.baomidou.mybatisplus.core.enums.IEnum;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.platform.qujia.utils.EnumsContainer;

/**
 * @date 2024/1/17
 */
public enum NewUserStatus implements IEnum<Integer>, IBaseEnum<Integer> {

    NOT_ACTIVE(0,"未激活"),
    ACTIVE(1,"已激活"),
    ;

    private final Integer code;
    private final String desc;

    NewUserStatus(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    @JsonValue
    public Integer getCode() {
        return code;
    }

    @Override
    public String getDesc() {
        return desc;
    }

    @Override
    public Integer getValue() {
        return code;
    }

    @Override
    public Integer getKey() {
        return code;
    }

    @JsonCreator
    public static NewUserStatus create(Integer value){
        if (value == null) {
            return null;
        }
        return EnumsContainer.getEnumByKey(NewUserStatus.class,value);
    }

}
